<template>
  <div class="home">
      <ly-tab
         v-model="selectedId"
         :items="items"
         :options="options"
         @change="handleChang"
         class="fix"
      ></ly-tab>
      <router-view/>
  </div>
</template>

<script>
export default {
  name: 'home',
    data(){
      return{
          selectedId:0,
          items:[
              {label: '热门'},
              {label: '服饰'},
              {label: '鞋包'},
              {label: '母婴'},
              {label: '百货'},
              {label: '食品'},
              {label: '内衣'},
              {label: '男装'},
              {label: '电器'}
          ],
          subRouterUrl:[
              '/home/hot','/home/dress','/home/box','/home/mbaby','/home/general','/home/food','/home/shirt','/home/man','/home/ele'
          ],
          options:{
              activeColor:'#e9232c'//设置选中颜色
          }
      }
    },
    methods:{
        handleChang(item,index){
            // console.log(index,item);
            // console.log(this.subRouterUrl);
            this.$router.replace(this.subRouterUrl[index])
        }
    }
}
</script>
<style scoped lang="stylus">
    .fix
        position fixed
        left 0
        top 0
        z-index 998
  .home
    width: 100%
    height: 100%
    background-color: #f5f5f5
</style>